package com.jiaofamily.localad.sdk.obj;

public class Ration implements Comparable<Ration>{
	public String appid = "";
	public String nid = "";
	public int type = 0;
	public String name = "";
	public int weight = 0;//percent to decide priority
	public String key = "";
	public String key2 = "";
	public String key3 = "";
	public int priority = 0;
	public String appVersion = "v1.0";
	public String sdkVersion = "";
	public boolean isEnabled=false;/*if this sdk is enabled*/
	  
	/*
	 * (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 * small one in first place
	 */
	public int compareTo(Ration obj) {
		// TODO Auto-generated method stub
		int otherWeight=obj.weight;
		if(this.weight<otherWeight){
			return -1;
		}else if(this.weight>otherWeight){
			return 1;
		}
		return 0;
	}

	@Override
	public String toString() {
		return "Ration [appid=" + appid + ", nid=" + nid + ", type=" + type
				+ ", name=" + name + ", weight=" + weight + ", key=" + key
				+ ", key2=" + key2 + ", key3=" + key3 + ", priority="
				+ priority + ", appVersion=" + appVersion + ", sdkVersion="
				+ sdkVersion + ", isEnabled=" + isEnabled + "]";
	}
}
